<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE>
<html>
<head>
    <title>给【${resultVo.result.loginName}】分配权限</title>

    <smLink1></smLink1>
    <smLink2>
        <style type="text/css">
            .role-ids {
                height: 250px;
                border: 1px solid #D5D5D5;
                overflow-x: auto;
                overflow-y: auto;
            }
        </style>
    </smLink2>

    <smScript1></smScript1>
    <smScript2>
        <script type="text/javascript" src="<%=basePath%>js/jsp/permission/update.js"></script>
    </smScript2>
</head>

<body>
<div id="breadcrumbs" class="breadcrumbs ace-save-state">
    <ul class="breadcrumb">
        <li>
            <a href="<%=basePath%>web/role/list.html">权限列表</a>
        </li>
        <li>
            <span>给【${resultVo.result.loginName}】分配权限</span>
        </li>
    </ul>
</div>

<div class="page-content">
    <div class="row">
        <div class="col-xs-7">
            <form id="permission_form" class="form-horizontal" role="form" method="post" action="<%=basePath%>web/permission/update.html">
                <input name="id" type="hidden" value="${resultVo.result.id}" placeholder="用户 ID">
                <input name="roleIds" type="hidden" value="" placeholder="多个角色 ID">

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right" for="role_name">姓名</label>

                    <div class="col-xs-9">
                        <input id="role_name" name="roleName" class="col-md-7" type="text" value="${resultVo.result.loginName}" readonly="readonly" placeholder="姓名">
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right" for="loginid">账号</label>

                    <div class="col-xs-9">
                        <input id="loginid" name="loginid" class="col-md-7" type="text" value="${resultVo.result.loginid}" readonly="readonly" placeholder="账号">
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right">已拥有的角色【点击删除】</label>

                    <div class="col-xs-9">
                        <div id="my_role" class="col-md-9 role-ids p-0"></div>
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right">未拥有的角色【点击添加】</label>

                    <div class="col-xs-9">
                        <div id="other_role" class="col-md-9 role-ids p-0"></div>
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-4 col-md-8">
                        <button name="submitBtn" class="btn btn-info" type="button">
                            <i class="ace-icon iconfont icon-plus"></i>提交
                        </button>
                    </div>
                </div>
            </form>
        </div>

        <div class="col-xs-5">
            <div class="col-xs-12 f-s-14 red">数据校验如下：</div>

            <div class="col-xs-12">
                <div class="alert alert-warning m-0 m-t-5 p-0">
                    <ol class="validate-ol f-s-12">
                        <li>1、姓名，只读；</li>
                        <li>2、账号，只读；</li>
                        <li>3、已拥有的角色，非必选。</li>
                    </ol>
                </div>
            </div>

            <div class="col-xs-12">
                <div id="role_detail" class="display-none alert alert-danger m-0 m-t-5 p-0">
                    <ol class="validate-ol f-s-12"></ol>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>